import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-01-12
 * Time: 11:03
 */
class Solution1 {
    public int[] twoSum(int[] nums, int target) {
        Map<Integer , Integer> hash = new HashMap<>();

        for(int i = 0 ; i < nums.length ; i++){
            int tem = target - nums[i];
            if(hash.containsKey(tem)){
                return new int[]{hash.get(tem),i};
            }
            hash.put(nums[i],i);
        }
        return new int[]{1};
    }
}
public class Test1 {
}
